Drop rustc-serialize dependency
authorAndronik Ordian <write@reusable.software>
Thu, 8 Jun 2017 20:08:59 +0000 (23:08 +0300)
committerAndronik Ordian <write@reusable.software>
Thu, 8 Jun 2017 21:56:48 +0000 (00:56 +0300)
46 files changed:
Cargo.lock
Cargo.toml
src/bin/bench.rs
src/bin/build.rs
src/bin/cargo.rs
src/bin/check.rs
src/bin/clean.rs
src/bin/doc.rs
src/bin/fetch.rs
src/bin/generate_lockfile.rs
src/bin/git_checkout.rs
src/bin/help.rs
src/bin/init.rs
src/bin/install.rs
src/bin/locate_project.rs
src/bin/login.rs
src/bin/metadata.rs
src/bin/new.rs
src/bin/owner.rs
src/bin/package.rs
src/bin/pkgid.rs
src/bin/publish.rs
src/bin/read_manifest.rs
src/bin/run.rs
src/bin/rustc.rs
src/bin/rustdoc.rs
src/bin/search.rs
src/bin/test.rs
src/bin/uninstall.rs
src/bin/update.rs
src/bin/verify_project.rs
src/bin/version.rs
src/bin/yank.rs
src/cargo/lib.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/sources/directory.rs
src/cargo/sources/registry/local.rs
src/cargo/sources/registry/remote.rs
src/cargo/util/config.rs
src/cargo/util/hex.rs
tests/cargotest/Cargo.toml
tests/cargotest/lib.rs
tests/cargotest/support/registry.rs
tests/directory.rs
tests/version.rs

index 92382674a39a48cd61f8c96a8b9ceb205a596300..375d563857d05d0c1528f55e00f518f9eb709620 100644 (file)
@@ -8,7 +8,7 @@ dependencies = [
  "crates-io 0.10.0",
  "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -18,6 +18,7 @@ dependencies = [
  "git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "jobserver 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -27,7 +28,6 @@ dependencies = [
  "num_cpus 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "semver 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -111,10 +111,10 @@ dependencies = [
  "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
  "git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -190,12 +190,13 @@ dependencies = [
 
 [[package]]
 name = "docopt"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -305,6 +306,11 @@ dependencies = [
  "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "hex"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "idna"
 version = "0.1.2"
@@ -870,7 +876,7 @@ dependencies = [
 "checksum curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c90e1240ef340dd4027ade439e5c7c2064dd9dc652682117bd50d1486a3add7b"
 "checksum curl-sys 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "23e7e544dc5e1ba42c4a4a678bd47985e84b9c3f4d3404c29700622a029db9c3"
 "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
-"checksum docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab32ea6e284d87987066f21a9e809a73c14720571ef34516f0890b3d355ccfd8"
+"checksum docopt 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63e408eee8a772c5c61f62353992e3ebf51ef5c832dd04d986b3dc7d48c5b440"
 "checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90"
 "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
 "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8"
@@ -884,6 +890,7 @@ dependencies = [
 "checksum git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68676bc784bf0bef83278898929bf64a251e87c0340723d0b93fa096c9c5bf8e"
 "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
 "checksum hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bf088f042a467089e9baa4972f57f9247e42a0cc549ba264c7a04fbb8ecb89d4"
+"checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa"
 "checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37"
 "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c"
 "checksum jobserver 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c43fc6e4066b2adf0539c854daa1d926d7f23e6926e019850d34b8ae46391b2e"
index 3435b05a51adf159848eb2dfd3d6c1a3b0790a0e..26401fbd40ea022b84aece78bc1abbadb4f831be 100644 (file)
@@ -20,7 +20,7 @@ path = "src/cargo/lib.rs"
 crates-io = { path = "src/crates-io", version = "0.10" }
 crossbeam = "0.2"
 curl = "0.4.6"
-docopt = "0.7"
+docopt = "0.8"
 env_logger = "0.4"
 error-chain = "0.10.0"
 filetime = "0.1"
@@ -29,12 +29,12 @@ fs2 = "0.4"
 git2 = "0.6"
 git2-curl = "0.7"
 glob = "0.2"
+hex = "0.2"
 jobserver = "0.1.4"
 libc = "0.2"
 libgit2-sys = "0.6"
 log = "0.3"
 num_cpus = "1.0"
-rustc-serialize = "0.3"
 scoped-tls = "0.1"
 semver = { version = "0.7.0", features = ["serde"] }
 serde = "1.0"
index c58ff5c087d87d6315506390101ab2559d02d8a8..9e34f7847258eb4cd36d694e0808d3fbaee8fd16 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops::{self, MessageFormat, Packages};
 use cargo::util::{CliResult, CliError, Config, CargoErrorKind};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_no_run: bool,
     flag_package: Vec<String>,
index 759c2746646d3163d754646ae29523ff4a6ed1f0..c679fc50f067673fe9f3be8f353e2a69ac02fa5a 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops::{self, CompileOptions, MessageFormat, Packages};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_package: Vec<String>,
     flag_jobs: Option<u32>,
index 23085116d026730abdcad378443df93db88f1941..ae4409723d43974a17670c09d8cfea79aaf069b1 100644 (file)
@@ -2,7 +2,6 @@ extern crate cargo;
 extern crate url;
 extern crate env_logger;
 extern crate git2_curl;
-extern crate rustc_serialize;
 extern crate toml;
 #[macro_use]
 extern crate log;
@@ -20,7 +19,7 @@ use cargo::core::shell::{Verbosity, ColorConfig};
 use cargo::util::{self, CliResult, lev_distance, Config, CargoResult, CargoError, CargoErrorKind};
 use cargo::util::CliError;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Flags {
     flag_list: bool,
     flag_version: bool,
index 147ff43b9a97e3b429207fc061fdde866e0b43d0..fd36f5420009fb87f84cf675effb93e8ef3e1c31 100644 (file)
@@ -49,7 +49,7 @@ the manifest. The default profile for this command is `dev`, but passing
 the --release flag will use the `release` profile instead.
 ";
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_package: Vec<String>,
     flag_jobs: Option<u32>,
index 8903f89031297e9fa24a00d0d75a5dfda3a1791b..661425e9e37f5b884d3f1cc3cf677031e0b20a4b 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_package: Vec<String>,
     flag_target: Option<String>,
index 11e44670faf4200137297a71ee725e7871b04fbe..6b4190985df2ceca07d9b029d576a5908d01bc01 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops::{self, MessageFormat, Packages};
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_target: Option<String>,
     flag_features: Vec<String>,
index 80aba98db928456eeabee9451a0355694d5a6446..6b61ba7d6892df0d70d09dd17dbb4c5db94637df 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: u32,
index f545b1e26f70662e377d43e5f455ae9864524d1e..60cb6c6566aa2f28c3cf91f19003a5aeabe7c132 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: u32,
index 4309f0163fed51dce746bd677d1c428f1f65f3e5..4841b5e4ea6c92a7706d964f28f090a7eb0c993f 100644 (file)
@@ -2,7 +2,7 @@ use cargo::core::source::{Source, SourceId, GitReference};
 use cargo::sources::git::{GitSource};
 use cargo::util::{Config, CliResult, ToUrl};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_url: String,
     flag_reference: String,
index f59e24f3ebd8c7902e774d69538bbbf07f493771..c5059e4ff5e15d687af38ee4ff7601d66835f2bc 100644 (file)
@@ -1,6 +1,6 @@
 use cargo::util::{CliResult, CliError, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options;
 
 pub const USAGE: &'static str = "
index 97dca61c9fedcc55c1d3fb9f3d646aa6589be654..be02789ec55aa8784cf77db208525fe04f86a4bb 100644 (file)
@@ -3,7 +3,7 @@ use std::env;
 use cargo::ops;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_verbose: u32,
     flag_quiet: Option<bool>,
index 197dcdd1be0a292cd240e8da042708258e5b6379..8d532e6bc1c1848c098b6142e03b9909935710d8 100644 (file)
@@ -2,7 +2,7 @@ use cargo::ops;
 use cargo::core::{SourceId, GitReference};
 use cargo::util::{CliResult, Config, ToUrl};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_jobs: Option<u32>,
     flag_features: Vec<String>,
index 7c7727aa221837f03b4f873523d675f59ce43a16..e0c6164e7c73789ac687eea85a8ec37aa5b6809a 100644 (file)
@@ -2,7 +2,7 @@ use cargo;
 use cargo::util::{CliResult, CliError, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct LocateProjectFlags {
     flag_manifest_path: Option<String>,
 }
index 6e7841717b69c53d5ee1cc08d8b45df48148f663..a9d6b1a710ae5b1922cc48376c7ea7c8e3b36274 100644 (file)
@@ -6,7 +6,7 @@ use cargo::core::{SourceId, Source};
 use cargo::sources::RegistrySource;
 use cargo::util::{CliResult, CargoResultExt, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_host: Option<String>,
     arg_token: Option<String>,
index 00d46c0059d1fcc7458da2c14103d2f5c6d36b6a..0811535307bd197296dbed9055f47957274aa510 100644 (file)
@@ -4,7 +4,7 @@ use cargo::ops::{output_metadata, OutputMetadataOptions};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_color: Option<String>,
     flag_features: Vec<String>,
index aeee334a9651f75a7d8e3b69c55ccf531029ffe4..bcf446c967c571399cc6c16829555ad97ad8f0cf 100644 (file)
@@ -3,7 +3,7 @@ use std::env;
 use cargo::ops;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_verbose: u32,
     flag_quiet: Option<bool>,
index 288d13e302c0e24da379d121c2ecf1a44d201e12..587a968a6bf05091e2cc94c0e49b372e1ba3415e 100644 (file)
@@ -1,7 +1,7 @@
 use cargo::ops;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index df342fbf8bfc697a7f692ec25c0f6ab0be20e4f8..e4c4af44968756ac9b3853148f34a2f286241e6d 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_verbose: u32,
     flag_quiet: Option<bool>,
index ea573361d9e8bccfdb02871ce3ac63ec4b0491a0..f8574139458ebaf2ca5078dd2ae47a85f3c445bd 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_verbose: u32,
     flag_quiet: Option<bool>,
index dcba4df07e27c53839ee85a7eda91760ac463263..3f0af0baaf72ff5dc674239d35eeb2ed1fd27fea 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_host: Option<String>,
     flag_token: Option<String>,
index 07c4a5f2c455d013e687eadb7ca956f2926bc954..c97456757d55566b390a11817cdd9478154155d8 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::Package;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_manifest_path: Option<String>,
     flag_color: Option<String>,
index 96c51bea24097011604ce42530b45f8762084e35..3ff26fc621200e2bac1fc7487f4064216b81e9b4 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops::{self, MessageFormat, Packages};
 use cargo::util::{CliResult, CliError, Config, CargoErrorKind};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_bin: Option<String>,
     flag_example: Option<String>,
index 3ee18a8623438b53b8eb41762c1f196f9b5e3d7e..0616e6f5e0869d1afb582e579faa183c78a297ba 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops::{self, CompileOptions, CompileMode, MessageFormat, Packages};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 use cargo::util::{CliResult, CliError, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     arg_opts: Option<Vec<String>>,
     flag_package: Option<String>,
index b6a8e640e2b03cfe0d8be284806831ba8c1edcbe..55ce9c89d61f106fe43941d1de0d9ea1d37d0eac 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops::{self, MessageFormat, Packages};
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::{find_root_manifest_for_wd};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     arg_opts: Vec<String>,
     flag_target: Option<String>,
index 47879cae5824451192f535b8fea4a3a5966487ad..c9794ad3e41194df2fe0ff009a2a26b6cf009a09 100644 (file)
@@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config};
 
 use std::cmp;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_host: Option<String>,
     flag_verbose: u32,
index 5fbae53f373b4c134c9a38f44da6bfd033fbbaf6..fe8d5757f8c3081af7797fb175b3d9791d383b6b 100644 (file)
@@ -3,7 +3,7 @@ use cargo::ops::{self, MessageFormat, Packages};
 use cargo::util::{CliResult, CliError, Config, CargoErrorKind};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     arg_args: Vec<String>,
     flag_features: Vec<String>,
index 725452251e1812a2a508892ca36884f8eed347af..619b029f511bee7f5d13d39f421ded2ddb35dd5b 100644 (file)
@@ -1,7 +1,7 @@
 use cargo::ops;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_bin: Vec<String>,
     flag_root: Option<String>,
index e8da2bd5cbcf870817d801433037e294549ff7b0..1890ab7cc61b46a4318e33dea4bdca2f7a08030f 100644 (file)
@@ -5,7 +5,7 @@ use cargo::ops;
 use cargo::util::{CliResult, Config};
 use cargo::util::important_paths::find_root_manifest_for_wd;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     flag_package: Vec<String>,
     flag_aggressive: bool,
index 26e11f96644ab5c87b540cffeb7f307f6f0c64e3..ea03bdd58c4c1830f2f470790413409409ea2eef 100644 (file)
@@ -9,7 +9,7 @@ use cargo::util::{CliResult, Config};
 use serde_json;
 use toml;
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Flags {
     flag_manifest_path: Option<String>,
     flag_verbose: u32,
index 9724481036ae4d21a59abd349d5427b14a69968a..a97c0fc03002d0fa261af9155d85958e8f4c6268 100644 (file)
@@ -3,8 +3,8 @@ use std::env;
 use cargo;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
-pub struct Options;
+#[derive(Deserialize)]
+pub struct Options {}
 
 pub const USAGE: &'static str = "
 Show version information
index 9e5663684ab8ca121ad16de845fc086baf11c215..de48639ecff4b8631d55b17ea130e7d71fe55dea 100644 (file)
@@ -1,7 +1,7 @@
 use cargo::ops;
 use cargo::util::{CliResult, Config};
 
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
 pub struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index 2fe2a572b13bf5a8bb1f3a763d375fee17df1d32..38ebe82ae520619b8778306a82e22a8560ef8db4 100755 (executable)
@@ -17,11 +17,11 @@ extern crate flate2;
 extern crate fs2;
 extern crate git2;
 extern crate glob;
+extern crate hex;
 extern crate jobserver;
 extern crate libc;
 extern crate libgit2_sys;
 extern crate num_cpus;
-extern crate rustc_serialize;
 extern crate semver;
 extern crate serde;
 extern crate serde_ignored;
@@ -37,7 +37,7 @@ use std::fmt;
 use std::error::Error;
 
 use error_chain::ChainedError;
-use rustc_serialize::Decodable;
+use serde::Deserialize;
 use serde::ser;
 use docopt::Docopt;
 
@@ -105,7 +105,7 @@ impl fmt::Display for VersionInfo {
     }
 }
 
-pub fn call_main_without_stdin<Flags: Decodable>(
+pub fn call_main_without_stdin<'de, Flags: Deserialize<'de>>(
             exec: fn(Flags, &Config) -> CliResult,
             config: &Config,
             usage: &str,
@@ -117,7 +117,7 @@ pub fn call_main_without_stdin<Flags: Decodable>(
         .argv(args.iter().map(|s| &s[..]))
         .help(true);
 
-    let flags = docopt.decode().map_err(|e| {
+    let flags = docopt.deserialize().map_err(|e| {
         let code = if e.fatal() {1} else {0};
         CliError::new(e.to_string().into(), code)
     })?;
index 888939a22034681caad923abd02718cdaf573c71..377fc8bc73e64cba618ac6161049572e8e28a30a 100644 (file)
@@ -96,7 +96,7 @@ pub enum CompileMode {
     Doctest,
 }
 
-#[derive(Clone, Copy, PartialEq, Eq, RustcDecodable)]
+#[derive(Clone, Copy, PartialEq, Eq, Deserialize)]
 pub enum MessageFormat {
     Human,
     Json
index 846e7c0d4448740aadbbe3d6b402a59b8e2b71a6..ad049e494e486802e377ea952e1d68433475194d 100644 (file)
@@ -3,7 +3,8 @@ use std::fs;
 use std::path::Path;
 use std::collections::BTreeMap;
 
-use rustc_serialize::{Decodable, Decoder};
+use serde::{Deserialize, Deserializer};
+use serde::de;
 
 use git2::Config as GitConfig;
 use git2::Repository as GitRepository;
@@ -43,16 +44,17 @@ struct MkOptions<'a> {
     bin: bool,
 }
 
-impl Decodable for VersionControl {
-    fn decode<D: Decoder>(d: &mut D) -> Result<VersionControl, D::Error> {
-        Ok(match &d.read_str()?[..] {
+impl<'de> Deserialize<'de> for VersionControl {
+    fn deserialize<D: Deserializer<'de>>(d: D) -> Result<VersionControl, D::Error> {
+        Ok(match &String::deserialize(d)?[..] {
             "git" => VersionControl::Git,
             "hg" => VersionControl::Hg,
             "pijul" => VersionControl::Pijul,
             "none" => VersionControl::NoVcs,
             n => {
-                let err = format!("could not decode '{}' as version control", n);
-                return Err(d.error(&err));
+                let value = de::Unexpected::Str(n);
+                let msg = "unsupported version control system";
+                return Err(de::Error::invalid_value(value, &msg));
             }
         })
     }
index d046131561103698fd207e80c75f0d11871694a8..bf025177875843b690118e3d8160c471d32e479b 100644 (file)
@@ -4,7 +4,8 @@ use std::fs::File;
 use std::io::Read;
 use std::path::{Path, PathBuf};
 
-use rustc_serialize::hex::ToHex;
+use hex::ToHex;
+
 use serde_json;
 
 use core::{Package, PackageId, Summary, SourceId, Source, Dependency, Registry};
index 203f3bc2560834d015435f5657f5c674c9a891e8..5803fd77d94a9607fd042652b73283e3c8f91332 100644 (file)
@@ -2,9 +2,8 @@ use std::io::SeekFrom;
 use std::io::prelude::*;
 use std::path::Path;
 
-use rustc_serialize::hex::ToHex;
-
 use core::PackageId;
+use hex::ToHex;
 use sources::registry::{RegistryData, RegistryConfig};
 use util::FileLock;
 use util::paths;
index 37b776b6d15dc9ba390848bf92170610ee12445a..2f9f7c87e56452b1ef9398ff0c03817bd8d93509 100644 (file)
@@ -6,7 +6,7 @@ use std::path::Path;
 
 use curl::easy::{Easy, List};
 use git2;
-use rustc_serialize::hex::ToHex;
+use hex::ToHex;
 use serde_json;
 use url::Url;
 
index a8bfb2eed3e2ba5f783a817e4634dc19f58d29ab..9ea62e94eefaabf13bda1556048c391e12e9a4e4 100644 (file)
@@ -15,7 +15,7 @@ use std::sync::{Once, ONCE_INIT};
 use core::MultiShell;
 use core::shell::{Verbosity, ColorConfig};
 use jobserver;
-use rustc_serialize::{Encodable,Encoder};
+use serde::{Serialize, Serializer};
 use toml;
 use util::Rustc;
 use util::errors::{CargoResult, CargoResultExt, CargoError, internal};
@@ -532,17 +532,17 @@ impl fmt::Debug for ConfigValue {
     }
 }
 
-impl Encodable for ConfigValue {
-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
+impl Serialize for ConfigValue {
+    fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
         match *self {
-            CV::String(ref string, _) => string.encode(s),
+            CV::String(ref string, _) => string.serialize(s),
             CV::List(ref list, _) => {
                 let list: Vec<&String> = list.iter().map(|s| &s.0).collect();
-                list.encode(s)
+                list.serialize(s)
             }
-            CV::Table(ref table, _) => table.encode(s),
-            CV::Boolean(b, _) => b.encode(s),
-            CV::Integer(i, _) => i.encode(s),
+            CV::Table(ref table, _) => table.serialize(s),
+            CV::Boolean(b, _) => b.serialize(s),
+            CV::Integer(i, _) => i.serialize(s),
         }
     }
 }
index 28fed76fc0f7f6480d04a8acf470e4f6928a39be..71a4c112fd30a440ae12c3ab7734c5dc4b4fbcc4 100644 (file)
@@ -1,9 +1,8 @@
 #![allow(deprecated)]
 
+use hex::ToHex;
 use std::hash::{Hasher, Hash, SipHasher};
 
-use rustc_serialize::hex::ToHex;
-
 pub fn to_hex(num: u64) -> String {
     [
         (num >>  0) as u8,
index e5c29f95ddde3264eb3c989158bf355572ffebdd..f5b1cc8ca3024ede61554d3e48462e88ccdd2d13 100644 (file)
@@ -13,10 +13,10 @@ filetime = "0.1"
 flate2 = "0.2"
 git2 = { version = "0.6", default-features = false }
 hamcrest = "=0.1.1"
+hex = "0.2"
 kernel32-sys = "0.2"
 libc = "0.2"
 log = "0.3"
-rustc-serialize = "0.3"
 serde = "1.0"
 serde_json = "1.0"
 tar = { version = "0.4", default-features = false }
index 33e58c0e2e5262528f31deb9a8da6a4d639c8608..919768c18871ddd8892f1b37a4af950837e16642 100644 (file)
@@ -6,8 +6,8 @@ extern crate filetime;
 extern crate flate2;
 extern crate git2;
 extern crate hamcrest;
+extern crate hex;
 extern crate libc;
-extern crate rustc_serialize;
 extern crate serde;
 #[macro_use]
 extern crate serde_json;
index 3eae943299217dc13fc310dfdbda59fc54849133..49ab93901756401026504fdd379c3c003f741d88 100644 (file)
@@ -6,7 +6,7 @@ use std::path::{PathBuf, Path};
 use flate2::Compression::Default;
 use flate2::write::GzEncoder;
 use git2;
-use rustc_serialize::hex::ToHex;
+use hex::ToHex;
 use tar::{Builder, Header};
 use url::Url;
 
index 8ff54c1476eb6da1afc72a3608013870c239ad48..96c520f5f7c709b4756eb340bfae4b32d2524d7c 100644 (file)
@@ -1,15 +1,15 @@
 #[macro_use]
 extern crate cargotest;
 extern crate hamcrest;
-extern crate rustc_serialize;
+#[macro_use]
+extern crate serde_derive;
+extern crate serde_json;
 
 use std::collections::HashMap;
 use std::fs::{self, File};
 use std::io::prelude::*;
 use std::str;
 
-use rustc_serialize::json;
-
 use cargotest::cargo_process;
 use cargotest::support::{project, execs, ProjectBuilder};
 use cargotest::support::paths;
@@ -33,7 +33,7 @@ struct VendorPackage {
     cksum: Checksum,
 }
 
-#[derive(RustcEncodable)]
+#[derive(Serialize)]
 struct Checksum {
     package: String,
     files: HashMap<String, String>,
@@ -58,7 +58,7 @@ impl VendorPackage {
 
     fn build(&mut self) {
         let p = self.p.take().unwrap();
-        let json = json::encode(&self.cksum).unwrap();
+        let json = serde_json::to_string(&self.cksum).unwrap();
         let p = p.file(".cargo-checksum.json", &json);
         p.build();
     }
index bc8c0c1b94c83914cc7a5a509059b81651111b89..57844c90a7c4e8dfb1740979e0a3f108c4505cdd 100644 (file)
@@ -1,7 +1,6 @@
 extern crate cargo;
 extern crate cargotest;
 extern crate hamcrest;
-extern crate rustc_serialize;
 
 use cargotest::support::{project, execs};
 use hamcrest::assert_that;